package net.zjitc.controller;

import net.zjitc.pojo.Category;
import net.zjitc.pojo.CategorySecond;
import net.zjitc.pojo.Product;
import net.zjitc.service.CategoryService;
import net.zjitc.service.impl.CategoryServiceImpl;
import net.zjitc.utils.dispacher.URLMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * Created by Administrator on 2017/12/6.
 */
public class UserProduct {
    CategoryService categoryService=new CategoryServiceImpl();
    @URLMapping(url = "/findByCid")
    public String findByCid(HttpServletRequest request, HttpServletResponse response){
        List<Category> clist = categoryService.findAll();
        request.setAttribute("clist",clist);
        return "WEB-INF/user/productList.jsp";
    }
    @URLMapping(url = "/findByCsid")
    public String findByCsid(HttpServletRequest request, HttpServletResponse response){
        List<Category> clist = categoryService.findAll();
        request.setAttribute("clist",clist);
        return "WEB-INF/user/product_secondList.jsp";
    }
}
